package com.zut.controller.house;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zut.entity.House;
import com.zut.service.HouseService;
import com.zut.service.impl.HouseServiceImpl;

/**
 * Servlet implementation class detailHouseServlet
 */
@WebServlet("/detailHouseServlet")
public class detailHouseServlet extends HttpServlet {
	HouseService hService = new HouseServiceImpl();
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int h_id = Integer.parseInt(request.getParameter("h_id"));
		House house = new House();
		house = hService.queryById(h_id);
		request.setAttribute("house", house);
		
		request.getRequestDispatcher("/view/flats/detail.jsp").forward(request, response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
